<template>
  <div class="vpt-item-view" :style="itemStyle">
    <div class="vpt-item-title" :style="itemTitleStyle">
      {{ title }}
      <slot name="title"></slot>
    </div>
    <slot name="content"></slot>
    <div class="vpt-item-data-list" v-if="showList">
      <slot></slot>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  title: { type: String, default: "" },
  showList: { type: Boolean, default: false },
  itemStyle: {
    type: Object,
    default: () => ({
      marginBottom: "0.16rem",
    }),
  },
  itemTitleStyle: {
    type: Object,
    default: () => ({
      fontSize: "0.14rem",
    }),
  },
});
</script>

<style lang="less" scoped>
.vpt-item-view {
  font-size: 0.16rem;
  width: 100%;
  .vpt-item-title {
    font-size: 0.16rem;
    font-weight: 500;
    color: #1D2129;
    letter-spacing: 0;
    // margin-bottom: 0.12rem;
    display: flex;
    align-items: center;
  }

  .vpt-item-data-list {
    width: 100%;
    display: flex;
    margin-top: 0.12rem;
    margin-bottom: 0.24rem;

    .item-data {
      display: flex;
      width: 4rem;
      align-items: center;
      // line-height: 0.4rem;

      label {
        font-size: 0.28rem;
        color: #111;
        margin-right: 0.1rem;
      }

      em {
        font-style: normal;
        font-size: 0.28rem;
      }
    }
  }

  .item-list {
    display: flex;
    .item-data {
      label {
        font-size: 28rem;
        color: #ffffffb3;
      }
      em {
        font-style: normal;
        font-size: 0.24rem;
      }
    }
  }
}
</style>